
function ClubInfo()
{
  this.SetForm=SetForm;
  this.MoveSelect=MoveSelect;
  this.MoveSelectIn=MoveSelectIn;
  this.MoveInputIn=MoveInputIn;
  this.MoveInput=MoveInput;
  this.MoveSelectOut=MoveSelectOut;
  this.MoveAll=MoveAll;
  this.MoveAllIn=MoveAllIn;
  this.MoveAllOut=MoveAllOut;
  this.GetSelectValue=GetSelectValue;
  this.MoveInputSelect =MoveInputSelect
  this.MoveInputSelectOut =MoveInputSelectOut
}
function SetForm(firstObj,secondObj)
{

  this.fObj=firstObj;
  this.sObj=secondObj;


}

function MoveSelect(from,to)
{
  var i,iNum,iCount;
  iNum=from.options.length;
  iCount=to.options.length;
  var flag=0;
  for(i=0;i<iNum;i++)
  {
	flag=0;
    if(from.options[i].selected)
    {
	  for (var j=0; j<iCount;j++ )
	  {
		  if (to.options[j].value==from.options[i].value)
		  {
			  flag=1;
			  break;
		  }
	  }
	  if (flag==0)
	  {
		  to.options[iCount++]=new Option(from.options[i].text,from.options[i].value);
		  from.options[i]=null;
		  i--;iNum--;
	  }
    }
  }
}
function MoveAll(from,to)
{
  var i,iNum,iCount;
  iNum=from.options.length;
  iCount=to.options.length;
  var flag=0;
  for(i=0;i<iNum;i++)
  {
	  flag=0;
	  for (var j=0; j<iCount;j++ )
	  {
		  if (to.options[j].value==from.options[i].value)
		  {
			  flag=1;
			  break;
		  }
	  }
	  if (flag==0)
	  {
		  to.options[iCount++]=new Option(from.options[i].text,from.options[i].value);
		  from.options[i]=null;
		  i--;iNum--;
	  }
  }
  from.options.length=0;
}
function MoveSelectIn()
{
  this.MoveSelect(this.fObj,this.sObj);
}







function MoveSelectOut()
{
  this.MoveSelect(this.sObj,this.fObj);
}

function MoveAllIn()
{
  this.MoveAll(this.fObj,this.sObj);
}
function MoveAllOut()
{
  this.MoveAll(this.sObj,this.fObj);
}
function GetSelectValue()
{
  var i,iNum;
  var rid="",rname="",rValue="";
  iNum=this.sObj.options.length;
  for(i=0;i<iNum;i++)
  {
    rid+=this.sObj.options[i].value+",";
    rname+=this.sObj.options[i].text+",";
  }
  if(rid.length>0) rid=rid.substr(0,rid.length-1);
  if(rname.length>0) rname=rname.substr(0,rname.length-1);
  rValue=rid+"||"+rname;
  if(rValue.length==1) rValue="||";
  return rValue;
}

function MoveInputIn()
{


  this.MoveInput(this.fObj,this.sObj);


}


function MoveInput(from,to)
{

  if ((from.value == null) || (from.value.length == 0))
  return false;

  var i,iNum,iCount;


  iCount=to.options.length;

    var flag=0;

	  for (var j=0; j<iCount;j++ )
	  {
		  if (to.options[j].value==from.value)
		  {
			  flag=1;
			  break;
		  }
	  }

	  if (flag==0)
	  {
		  to.options[iCount++]=new Option(from.value,from.value);
		  from.value='';
		  i--;iNum--;
	  }


}

function MoveInputSelectOut()
{

  this.MoveInputSelect(this.sObj);
}




function MoveInputSelect(from)
{

  var i,iNum,iCount;
  iNum=from.options.length;
  var flag=0;
  for(i=0;i<iNum;i++)
  {
	flag=0;
    if(from.options[i].selected)
    {
		  from.options[i]=null;
		  i--;iNum--;

    }
  }
}







